﻿using Web.Logic.Models;

namespace Web.Logic.ViewModels
{
    public class FilterViewModel
    {
        public int IdFrom;
        public int IdTo;

        public FilterSet CreateFilterSet()
        {
            var filterSet = new FilterSet();

            if (IdFrom != null)
                filterSet.AddFilterUnit(x => x.Id >= IdFrom);
            if (IdTo != null)
                filterSet.AddFilterUnit(x => x.Id <= IdTo);

            return filterSet;
        }
    }
}